/*YuO8szH0cVixePu/Bt+mG1gKq30H3D/uz7NqnFHWvKNPiKF8O+a7O5mr5fDliKf8*/
/*
 * @Author: xiahui 
 * @PageInfo: 查询按钮
 * @Date: 2019-01-10 17:11:58 
 * @Last Modified by: huoyzh
 * @Last Modified time: 2020-04-09 12:09:44
 */
import { AREA, BUTTONID, DATASOURCECACHE, DEFCACHEKEY, FIELDS } from '../../constance';
import { setDefData } from '../../../../../scmpub/scmpub/pub/cache';
import commonSearch from './commonSearch';
import { getLangByResId } from '../../../../../scmpub/scmpub/pub/tool/multiLangUtil';
import { showWarningInfo } from '../../../../../scmpub/scmpub/pub/tool/messageUtil.js';
export default function(props) {
	let queryInfo = props.search.getQueryInfo(AREA.searchId, true); //必输项为空时，返回值为false;
	if (!queryInfo || !queryInfo.querycondition) {
		return;
	}
	// 刷新按钮状态
	props.button.setDisabled(BUTTONID.Refresh, false);
	// 缓存查询条件
	setDefData(DATASOURCECACHE.dataSourceListCacheKey, DEFCACHEKEY.queryCacheKey, queryInfo);

	let msboundVal = false;
	let msVal = false;
	queryInfo.querycondition.conditions.forEach((item, index) => {
		if (item.field == FIELDS.marbasclassbound) {
			msboundVal = true;
		} else if (item.field == 'pk_ct_pu_b.pk_marbasclass') {
			msVal = true;
		}
	});
	if (msboundVal && !msVal) {
		showWarningInfo(getLangByResId(this, '4004PURDAILY-000068'));
		return;
	} else if (!msboundVal && msVal) {
		showWarningInfo(getLangByResId(this, '4004PURDAILY-000069'));
		return;
	}
	// 查询
	commonSearch.call(this, props, queryInfo);
}

/*YuO8szH0cVixePu/Bt+mG1gKq30H3D/uz7NqnFHWvKNPiKF8O+a7O5mr5fDliKf8*/